ocaml: remove bogus /dev/xen/ev[en]tchn
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 24 Jun 2010 11:45:32 +0000 (12:45 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 24 Jun 2010 11:45:32 +0000 (12:45 +0100)
Oxenstored should not try to create the evtchn device, as it:

    * creates the wrong name (/dev/xen/eventchn rather than evtchn)
    * uses a hard-coded minor number, even though this dynamically
      depends on what other misc devices are in the kernel

Remove all this code and just rely on the system to create the device.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
tools/ocaml/libs/eventchn/eventchn_stubs.c

index 210aa30afaddcfca697fcec0d683bf45f527db88..e5d15911882ee920a4b187bd272e5ee1bcc1c6b7 100644 (file)
 #include <caml/callback.h>
 #include <caml/fail.h>
 
-#define EVENTCHN_PATH "/dev/xen/eventchn"
-
-static int eventchn_major = 10;
-static int eventchn_minor = 61;
+#define EVENTCHN_PATH "/dev/xen/evtchn"
 
 static int do_ioctl(int handle, int cmd, void *arg)
 {
@@ -56,15 +53,7 @@ static int do_write_port(int handle, evtchn_port_t port)
 
 int eventchn_do_open(void)
 {
-       int fd;
-
-       fd = open(EVENTCHN_PATH, O_RDWR);
-       if (fd == -1 && errno == ENOENT) {
-               mkdir("/dev/xen", 0640);
-               mknod(EVENTCHN_PATH, S_IFCHR | 0640, makedev(eventchn_major, eventchn_minor));
-               fd = open(EVENTCHN_PATH, O_RDWR);
-       }
-       return fd;
+       return open(EVENTCHN_PATH, O_RDWR);
 }
 
 CAMLprim value stub_eventchn_init(value unit)